package com.passioneffect.widgets {
	import flash.display.DisplayObjectContainer;
	import flash.display.Graphics;
	import flash.events.Event;
	
	import com.passioneffect.widgets.RectGrow;	

	/**
	 * @author Passion Effect
	 */
	public class SlideRect extends RectGrow {
		public function SlideRect(mc : DisplayObjectContainer, length : *, color : Number, alpha : Number = 1, time : Number = 0.2) {
			super(mc, length, color, alpha, time);
		}
		
		override public function draw(evt : Event = null) : void {
			var l:Number=length;
			if(type=="percent"){
				l=target.height*length;
			}
			
			var g : Graphics = eff.graphics;
			g.clear();
			g.lineStyle();
			g.beginFill(_color, _alpha);
			g.drawRect(0,target.height-l*target.height,target.width,l);
			
			g.endFill();
			
		}
	}
}
